package com.eight.system.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.eight.common.pojo.AclPermission;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 向文豪
 * @program: eight-education-parent
 * @description:
 * @date 2023/5/23 20:59
 */
public interface AclPermissionDao extends BaseMapper<AclPermission> {
    @Select(value = "select p.* from acl_permission p join acl_role_permission rp on p.id=rp.permission_id\n" +
            "join acl_user_role ur on ur.role_id=rp.role_id where ur.user_id=#{userId} and type=1")
    List<AclPermission> selectByUserId(String userId);

}
